package cli

import (
	"gitee.com/huanghua_2017/blade/client-cgo/clientcore"
	cli "github.com/urfave/cli/v2"
)

var RunCmd = &cli.Command{
	Name:  "run",
	Usage: "启动程序",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "log_path",
			Usage: "日志路径 例如: ./",
			Value: ".",
		},
		&cli.StringFlag{
			Name:  "config",
			Usage: "配置文件路径 例如: ./client_config.json",
			Value: "./client_config.json",
		},
	},
	Action: func(cctx *cli.Context) error {
		lp := cctx.String("log_path")
		config := cctx.String("config")
		return clientcore.StartClient(lp, config)
	},
}
